<template>
  <div class="item">
    <div class="top">
      <div class="ck_pic">
        <input type="checkbox" v-model="item.isSelected" class="ck" />
        <img :src="item.coverImgUrl" alt="" />
      </div>
      <div class="tag">
        {{ tags }}
      </div>
    </div>
    <p class="btm">{{ item.name }}</p>
  </div>
</template>

<script setup>
const props = defineProps({
  item: {
    required: true,
    type: Object,
  },
});
const tags = computed(() => {
  return props.item.tags.join("/");
});


</script>

<style lang="scss" scoped>
.item {
  border: 1px solid #999;
  padding: 10px;
  height: 100px;
  margin-bottom: 3px;
  font-size: 12px;
  &:hover {
    background-color: #eee;
    .tag {
      display: none;
    }
  }
  .top {
    display: flex;
    align-items: center;
    margin-bottom: 13px;
    .ck_pic {
      .ck {
        margin-right: 5px;
      }
      img {
        width: 42px;
        margin-right: 40px;
      }
    }
    .tag {
      background-color: #683983;
      padding-inline: 7px;
      padding-block: 9px;
      border-radius: 10px;
      color: #fff;
    }
  }
}
</style>
